﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Controls.Theming;
using System.Windows.Browser;
using PPFinance.Common;

namespace PPFinance.UI
{
    public partial class ThemeContainer : UserControl
    {
        public string CurrentTheme { get; set; }
        public ThemeContainer()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(ThemeContainer_Loaded);
        }

        void ThemeContainer_Loaded(object sender, RoutedEventArgs e)
        {
            Cookies cks = new Cookies();
            ChangeTheme(new ThemeCollection()[cks["Theme"]]);
        }



        public void ChangeTheme(ThemeData theme)
        {
            theme.Theme.Content = new MainPage();
            this.Content = theme.Theme;
            CurrentTheme = theme.ThemeName;
            Cookies cks = new Cookies();
            cks["Theme"] = CurrentTheme;
        }
    }
}
